/*
 * app_convert.c
 *
 *  Created on: Oct 17, 2013
 *      Author: Omar Sevilla
 */
#include "stdtypedef.h"
#include "app_convert.h"


 T_UWORD 	rub_BCDUni = 0,
			rub_BCDDec = 0,
			rub_BCDCen = 0,
			rub_BCDUmil = 0,
			rub_BCDDmil = 0,
			rub_BCDCmil = 0;

void bin2bcd(T_UWORD luw_Bin_Data){
	T_UWORD luw_aux;
	luw_aux = luw_Bin_Data;
	rub_BCDCmil = (luw_aux / 100000);
	luw_aux = (luw_aux - (rub_BCDCmil*100000)); 
	rub_BCDDmil = (luw_aux / 10000);
	luw_aux = (luw_aux - (rub_BCDDmil*10000)); 
	rub_BCDUmil = (luw_aux / 1000);
	luw_aux = (luw_aux - (rub_BCDUmil*1000)); 
	rub_BCDCen = (luw_aux / 100);
	luw_aux = (luw_aux - (rub_BCDCen*100));
	rub_BCDDec = (luw_aux / 10);
	luw_aux = (luw_aux - (rub_BCDDec*10));
	rub_BCDUni = (luw_aux);
}

void bcd2ascii(){
	rub_BCDUni += 0x30;
	rub_BCDDec += 0x30;
	rub_BCDCen += 0x30;
	rub_BCDUmil += 0x30;
	rub_BCDDmil += 0x30;
	rub_BCDCmil += 0x30;
}


